<?php

$currency_display = ps_vendor::get_currency_display_style( $vendor_currency_display_style );
if( $GLOBALS['product_currency'] != $vendor_currency ) {
	$currency_display["symbol"] = $GLOBALS['product_currency'];
}
$GLOBALS['CURRENCY_DISPLAY2'] = new CurrencyDisplay($currency_display["id"], $currency_display["symbol"], 0, $currency_display["sdecimal"], $currency_display["thousands"], $currency_display["positive"], $currency_display["negative"]);



function calc_monthly_product_cost($sum, $rate, $months, $monthsfee) {
	$average_interest_period = 45;
	$calcRate = ($rate / 10000);

	$interest_value = ($average_interest_period / 365.0) * $calcRate * $sum;
	$periodic_cost =  ($sum + $interest_value)/$months;
	
	return ceil($periodic_cost/100);
}
?>